package Java复习;

public class Person {
    String name;
    int age;

    public Person() {
        System.out.println("执行父类构造方法1 ");
    }

    public Person(String name, int age) {
        System.out.println("执行父类构造方法2 ");
        this.name = name;
        this.age = age;
    }
}
class student extends Person{
    String sno;
    String age;
    public student() {
        System.out.println("执行子类构造方法1 ");
    }
    public student(String name, int age, String sno) {
        super(name, age);
        this.sno = sno;
        System.out.println("执行子类构造方法2 ");
    }

    public static void main(String[] args) {
        student st2 = new student("lisi", 21, "2019002");
        System.out.println(st2.name);
        System.out.println(st2.age);
    }
}
